package mapper.sys;

import java.util.Date;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.common.BaseMapper;

public interface FunMapper<T> extends BaseMapper<T> {
	@Insert("INSERT INTO sys_fun(id,title,linkurl,pid,iconurl,iconCls,sort,target) values (#{id},#{title},#{linkurl},#{pid},#{iconurl},#{iconCls},#{sort},#{target})")
	public void add(@Param("m")Map<String,Object> m);
	
	@Select("SELECT * FROM sys_fun WHERE id=#{m}")
	@Results({
		@Result(id=true,property="id",column="id",javaType=String.class),
		@Result(property="title",column="title",javaType=String.class),
		@Result(property="linkurl",column="linkurl",javaType=String.class),
		@Result(property="pid",column="pid",javaType=String.class),
		@Result(property="bigurl",column="bigurl",javaType=String.class),
		@Result(property="iconurl",column="iconurl",javaType=String.class),
		@Result(property="iconCls",column="iconCls",javaType=String.class),
		@Result(property="sort",column="sort",javaType=Integer.class),
		@Result(property="target",column="target",javaType=String.class)
	})
	public Map queryById(@Param("m")String id);
	

	@Update("UPDATE sys_fun SET title=#{title},linkurl=#{linkurl},pid=#{pid},iconurl=#{iconurl},iconCls=#{iconCls},sort=#{sort},target=#{target} WHERE id=#{id}")
	public void update(@Param("m")Map<String,Object> m);
	
	public void batchDeletes(@Param("list")List<String> list);
}